#include <vector>
using namespace std;
const int MAXN = 100;
const int INF = 100000000;
struct edge
{
    int v;              //目标节点
    int weight;         //边权重
};                      //边结点
vector<edge> adj[MAXN]; //结点数组
int d[MAXN];
int n; //n为结点数
bool visit[MAXN] = {false};
void Dijkstra(int s)
{ //时间复杂度O(v^2+E)
    //初始化
    fill(d, d + MAXN, INF);
    d[s] = 0;
    int min, m;
    for (int i = 0; i < n; ++i)
    { //循环n次，每次访问一个结点
        min = INF;
        m = -1;
        for (int j = 0; j < n; ++j)
        { //找出当前未被访问节点中距离源点最短的
            if (min > d[j] && false == visit[j])
            {
                min = d[j];
                m = j;
            }
        }
        if (-1 == m)
            return;
        for (int k = 0; k < adj[m].size(); ++k)
        {
            int v = adj[m][k].v;
            int w = adj[m][k].weight;
            if (d[m] + w < d[v])
            {
                d[v] = d[m] + w;
            }
        }
    }
}